package com.china.produce.controller;

import com.china.produce.service.ContextService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.script.RedisScript;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.time.Instant;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2024/7/6
 */
@RequestMapping("/context")
@RestController
public class ContextController {

    @Autowired
    private ContextService contextService;

    /**
     * 异步上下文处理
     *
     * @param httpServletRequest
     */
    @RequestMapping(value = "/asyncContext", method = RequestMethod.POST)
    public void asyncContext(HttpServletRequest httpServletRequest) {

        contextService.asyncDispatch(httpServletRequest);

        System.out.println("--++--");
    }


}
